
import Fluent


struct CreateEmployeeCountryPivot: Migration {
  func prepare(on database: Database) -> EventLoopFuture<Void> {
    database.schema("employee-country-pivot")
      .id()
      .field("employeeID", .uuid, .required, .references("employee", "id", onDelete: .cascade))
      .field("countryID", .uuid, .required, .references("countries", "id", onDelete: .cascade))
      .create()
  }
  
  func revert(on database: Database) -> EventLoopFuture<Void> {
    database.schema("employee-country-pivot").delete()
  }
}
